import fetch from 'common/src/utils/fetch';
let BASE_URL = '/api/graduationservice';
/**
 * 方法说明
 * @param {string} isOverseas  是否是留学生 0:国内学生 1：留学生
 */
let getStudentPoint = (isOverseas) => {
  return fetch({
    url: `${BASE_URL}/setDegreeStandard/selSetDegreeStandard?isOverseas=${isOverseas}`,
    method: 'get'
  });
}

let setStudentPoint = (id, scorePoint, isOverseas, isHsk) => {
  let data = {
    id,
    scorePoint,
    isOverseas
  };
  if (isHsk) {
    data.isHsk = isHsk;
  }
  return fetch({
    url: `${BASE_URL}/setDegreeStandard/setDegreeStandard`,
    method: 'post',
    data
  });
}

// 毕业审核批次列表查询
let getGraduateReviewBatch = (data) => {
  return fetch({
    url: `${BASE_URL}/graduateReviewBatch/findAllGraduateReviewBatch`,
    method: 'post',
    data
  })
} 

// 毕业审核权限列表查询
let queryGraduateReviewAuthList = (data) => {
  return fetch({
    url: `${BASE_URL}/graduateReviewAuth/findGraduateReviewAuthList`,
    method: 'post',
    data
  })
}

let reviewAuthBatchClose = (data) =>{
  return fetch({
    url: `${BASE_URL}/graduateReviewAuth/batchClose`,
    method: 'post',
    data
  })
}

let reviewAuthBatchOpen = (data) =>{
  return fetch({
    url: `${BASE_URL}/graduateReviewAuth/batchOpen`,
    method: 'post',
    data
  })
}

// 新增毕业审核批次
let addGraduateReviewBatch = (data) =>{
  return fetch({
    url: `${BASE_URL}/graduateReviewBatch/addGraduateReviewBatch`,
    method: 'post',
    data
  })
}

// 编辑毕业审核批次
let updateGraduateReviewBatch = (data) =>{
  return fetch({
    url: `${BASE_URL}/graduateReviewBatch/updateGraduateReviewBatch`,
    method: 'post',
    data
  })
}

//查询专业
let getProfessionList = (data) =>{
  return fetch({
     url: '/api/commonservice/campusProfession/findCampusProfessionList',
     method: 'post',
     data
  })
}

//查询专业方向
let findDirMaintenList = (data) =>{
  return fetch({
      url: '/api/commonservice/directionMainten/findDirectionMaintenList',
      method: 'post',
      data
  })
}

let geStandardLabel = (data) =>{
  return fetch({
    url: `${BASE_URL}/graduateStandardMaintainLabel/geStandardLabel`,
    method: 'post',
    data
  })
}

let saveStandardLabel = (data) =>{
  return fetch({
    url: `${BASE_URL}/graduateStandardMaintainLabel/saveStandardLabel`,
    method: 'post',
    data
  })
}

let saveStandardElective = (data) =>{
  return fetch({
    url: `${BASE_URL}/graduateStandardMaintainElective/saveStandardElective`,
    method: 'post',
    data
  })
}

let manualSetLeaveSchool = (data) =>{
  return fetch({
    url: `${BASE_URL}/graduateReviewBatch/manualSetLeaveSchool`,
    method: 'post',
    data
  })
}

let findPrincipalManagementList = (data) =>{
  return fetch({
    url: `${BASE_URL}/principalManagement/findPrincipalManagementList`,
    method: 'post',
    data
  })
}

let addPrincipalManagementList = (data) =>{
  return fetch({
    url: `${BASE_URL}/principalManagement/addPrincipalManagementList`,
    method: 'post',
    data
  })
}

let updatePrincipalManagementList = (data) =>{
  return fetch({
    url: `${BASE_URL}/principalManagement/updatePrincipalManagementList`,
    method: 'post',
    data
  })
}

let deletePrincipalManagementList = (data) =>{
  return fetch({
    url: `${BASE_URL}/principalManagement/deletePrincipalManagementList`,
    method: 'post',
    data
  })
}

// 查询老师
let findTeacherInfoList = (data) =>{
  return fetch({
    url: '/api/studentservice/teacherInfo/findTeacherInfoList',
    method: 'post',
    data
  })
}

// 结业换毕业 审核批次列表查询
let completeGetGraduateReviewBatch = (data) => {
  return fetch({
    url: `${BASE_URL}/suspendToGraduateReviewBatch/findAllGraduateReviewBatch`,
    method: 'post',
    data
  })
} 

// 结业换毕业 新增毕业审核批次
let completeAddGraduateReviewBatch = (data) =>{
  return fetch({
    url: `${BASE_URL}/suspendToGraduateReviewBatch/addGraduateReviewBatch`,
    method: 'post',
    data
  })
}

// 结业换毕业 编辑毕业审核批次
let completeUpdateGraduateReviewBatch = (data) =>{
  return fetch({
    url: `${BASE_URL}/suspendToGraduateReviewBatch/updateGraduateReviewBatch`,
    method: 'post',
    data
  })
}

// 结业换毕业审核权限列表查询
let completeQueryGraduateReviewAuthList = (data) => {
  return fetch({
    url: `${BASE_URL}/suspendToGraduateReviewAuth/findGraduateReviewAuthList`,
    method: 'post',
    data
  })
}

// 结业换毕业审核权限批量关闭
let completeReviewAuthBatchClose = (data) =>{
  return fetch({
    url: `${BASE_URL}/suspendToGraduateReviewAuth/batchClose`,
    method: 'post',
    data
  })
}

// 结业换毕业审核权限批量开启
let completeReviewAuthBatchOpen = (data) =>{
  return fetch({
    url: `${BASE_URL}/suspendToGraduateReviewAuth/batchOpen`,
    method: 'post',
    data
  })
}

//结业转毕业离校处理
let completeManualSetLeaveSchool = (data) =>{
  return fetch({
    url: `${BASE_URL}/suspendToGraduateReviewBatch/manualSetLeaveSchool`,
    method: 'post',
    data
  })
}

let getProfessionByGrade = (data) => {
  return fetch({
    url: '/api/commonservice/campusProfession/graduation/profession',
    method: 'post',
    data
  })
}

let suspendToGetPreviewCount = (data) =>{
  return fetch({
    url: `${BASE_URL}/suspendToGraduateList/group/count`,
    method: 'post',
    data
  })
}

let getPreviewCount = (data) =>{
  return fetch({
    url: `${BASE_URL}/graduateList/group/count`,
    method: 'post',
    data
  })
}

//毕业资格审核----提交审核结论
let submitReviewConclusion = (data) =>{
  return fetch({
    url: `${BASE_URL}/graduateList/submit`,
    method: 'post',
    data
  })
}

let getDefaultQuery = (config)=>{
  return fetch(config);
}

//新增学生信息 参数studentIds(字符串，多个id逗号拼接)
let addStudentInfo = (params) =>{
  return fetch({
    url: `${BASE_URL}/graduateList/insertGraduateList`,
    method: 'get',
    params
  })
}

//查询在读在籍学生 参数pageNum，pageSize，isOverseas，condition(模糊条件)
let findStudentStatusInfo = (params) =>{
  return fetch({
    url: `${BASE_URL}/graduateList/findStudentStatusInfo`,
    method: 'get',
    params
  })
}

// 编辑学生信息
let editStudentInfo = (params) =>{
  return fetch({
    url: `${BASE_URL}/graduateList/updateGraduateListByStudentId`,
    method: 'get',
    params
  })
}

let deleteStudentInfo = (params) =>{
  return fetch({
    url: `${BASE_URL}/graduateList/deleteGraduateList`,
    method: 'get',
    params
  })
}

//批量设置无效
let completeBatchValid = (params) =>{
  return fetch({
    url: `${BASE_URL}/suspendToGraduateList/batchValid`,
    method: 'get',
    params
  })
}

let completefindStudentStatusInfo = (params) =>{
  return fetch({
    url: `${BASE_URL}/suspendToGraduateList/findStudentStatusInfo`,
    method: 'get',
    params
  })
}

// 新增结业学生信息
let completeAddStudentInfo = (params) =>{
  return fetch({
    url: `${BASE_URL}/suspendToGraduateList/insertGraduateList`,
    method: 'get',
    params
  })
}

let completeEditStudentInfo = (params) =>{
  return fetch({
    url: `${BASE_URL}/suspendToGraduateList/updateGraduateListByStudentId`,
    method: 'get',
    params
  })
}

let completeDeleteStudentInfo = (params) =>{
  return fetch({
    url: `${BASE_URL}/suspendToGraduateList/deleteGraduateList`,
    method: 'get',
    params
  })
}

let findStaProfessionList = (data) => {
    return fetch({
        url: `${BASE_URL}/graduateList/findStaProfessionList`,
        method: 'post',
        data
    })
}
//毕业审核标准页面增加查学院接口

let queryFacultyListByGrade = (params) => {
    return fetch({
        url: `${BASE_URL}/graduateList/findFacultyList`,
        method: 'get',
        params
    })
}

export default {
  getStudentPoint,
  setStudentPoint,
  getGraduateReviewBatch,
  queryGraduateReviewAuthList,
  reviewAuthBatchClose,
  reviewAuthBatchOpen,
  addGraduateReviewBatch,
  updateGraduateReviewBatch,
  getProfessionList,
  findDirMaintenList,
  geStandardLabel,
  saveStandardLabel,
  saveStandardElective,
  manualSetLeaveSchool,
  getProfessionByGrade,
  getPreviewCount,
  submitReviewConclusion,
  suspendToGetPreviewCount,
  editStudentInfo,
  addStudentInfo,
  findStudentStatusInfo,
  deleteStudentInfo,
  completefindStudentStatusInfo,
  completeAddStudentInfo,
  completeEditStudentInfo,
  completeDeleteStudentInfo,
  findStaProfessionList
}

export {
  findPrincipalManagementList,
  addPrincipalManagementList,
  updatePrincipalManagementList,
  deletePrincipalManagementList,
  completeGetGraduateReviewBatch,
  completeAddGraduateReviewBatch,
  completeUpdateGraduateReviewBatch,
  completeQueryGraduateReviewAuthList,
  completeReviewAuthBatchClose,
  completeReviewAuthBatchOpen,
  findTeacherInfoList,
  completeManualSetLeaveSchool,
  getDefaultQuery,
  completeBatchValid,
  queryFacultyListByGrade
}